package com.appcan.sync.common;

import java.util.Properties;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.quartz.Scheduler;
import org.quartz.impl.StdSchedulerFactory;

public class SchedulerLoader {

	private static StdSchedulerFactory schedulerFactory = null;
	
	private static final Log log = LogFactory.getLog(SchedulerLoader.class);
	
	/**
	 * ��ȡschedulerʵ��
	 * @return
	 * @throws Exception
	 */
	public static Scheduler getSchedulerInst() throws Exception {
		try {
			Properties quartzProperties = SchedulerUtil.loadQuartzProperty();
			schedulerFactory = new StdSchedulerFactory(quartzProperties);
		}
		catch (Exception e) {
			log.error("����schedulerʵ�����쳣");
			throw new Exception(e);
		}
		return schedulerFactory.getScheduler();
	}
	
}